<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>熊猫优选购物车</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/cart.css">
</head>

<body>
    <div class="header">
        <img src="../img/header-logo.png" alt="logo">
        <h1>熊猫优选&emsp;&emsp;年轻人的购物选择~</h1>
    </div>
    <div class="container">
        <div class="book-list">
           
                <table>
                    <script type="text/html" id="cartProduct">
                    <tr class='th'>
                        <th>商品图片</th>
                        <th>商品信息</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>总价</th>
                        <th>操作</th>
                    </tr>
                    <tr>
                        {{each productList}}
                        <td><img src="{{$value.img}}" alt="shop03"></td>
                        <td>{{$value.title}}</td>
                        <td>￥{{$value.price}}</td>
                        <td><input type="button" name="minus" value="-" class="minus" onclick="minus({{$value.id}})"><input type="text" name="amount"
                                value="{{$value.num}}" class='amount'><input type="button" name="plus" value="+"
                                class="plus" onclick="add({{$value.id}})"></td>
                        <td class="singleprice" width="100px">￥{{($value.num*$value.price).toFixed(2)}}</td>
                        <td><a href="#" class="removebtn" onclick="addShoucang({{$value.id}})">移入收藏</a><br><a class="deletebtn" href="#" onclick="deleteProduct({{$value.id}})">删除</a></td>
                    </tr>
                    {{/each}}
            </script>
            </table>
            <h2>商品总价: <span id="totalPrice">￥0</span></h2>
        </div>
    </div>

    <script src="../js/jquery-3.6.0.js"></script>
    <script src="../js/template-web.js"></script>
    <script src="../js/cart.js"></script>
</body>

</html>